﻿using DoNetDrive.Core.Command;
using Face8280WebSocketServer.Command.Models;
using Newtonsoft.Json.Serialization;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Face8280WebSocketServer.Command.Search
{
    public class UDPSerachResult : INCommandResult
    {
        public List<DeviceSerach> ResultObj;
        public List<string> SN;
        public UDPSerachResult()
        {
            ResultObj = new List<DeviceSerach>();
            SN = new List<string>();
        }

        public void Add(string sJson)
        {
            var val = sJson.FromJson<DeviceSerach>();
            if (!SN.Contains(val.SN))
            {
                ResultObj.Add(val);
                SN.Add(val.SN);
            }
        }
        public void Dispose()
        {

        }
    }
}
